<template>
  <div>
    <el-dialog style="padding:0;" top="20vh" :show-close="false" v-model="loginDialogVisible" width="520">
      <template #header>
        <div class="dialog-title">
          <div class="dialog-title-text">{{ diaLog }}</div>
          <div class="dialog-title-icon" @click="loginDialogVisible = false"><el-icon>
              <Close />
            </el-icon></div>
        </div>
      </template>
      <div class="diabody">
        <LoginForm v-if="operate === 'login'" />
        <LoginRegisteForm v-if="operate === 'register'" />
      </div>
    </el-dialog>
  </div>
</template>

<script setup>
import { Close } from '@element-plus/icons-vue'
const loginDialogVisible = ref(true);
const operate = ref('login')
const diaLog = ref('登录')

</script>

<style lang="scss" scoped>
.dialog-title {
  padding: 12px 0;
  position: relative;

  .dialog-title-text {
    text-align: center;
    font-family: PingFang SC, PingFang SC;
    font-weight: 500;
    font-size: 16px;
    color: #333333;
  }

  .dialog-title-icon {
    position: absolute;
    width: 48px;
    height: 48px;
    right: 0;
    top: 53%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;

    &:hover {
      color: #1989fa;
    }
  }
}


:deep(.el-dialog__body) {
  border-top: 1px solid #eeeeee;
}

:deep(.el-dialog__header) {
  padding: 0;
}
</style>
